package com.newway.back.controller;

import com.newway.back.entity.SysMenuEntity;
import com.newway.back.service.SysMenuService;
import com.newway.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/back/sys/menu")
public class SysMenuController {

    @Autowired
    SysMenuService sysMenuService;

    @GetMapping(value = "/nav")
    public Result findMenuByUserId(){
        //组装所有菜单
        List<SysMenuEntity> menuList = sysMenuService.selectMenuById(1);
        return Result.success(menuList);
    }
}
